Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "data" parameter to all mint/transfer methods #75

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

awrichar
Copy link
Contributor

When performing token transfers, it's often beneficial to include additional data alongside the transfer. This can be to indicate the reason for the transfer, to tie it to an off-chain transaction, or to provide special instructions to derived token variants without altering the original contract interface.

One way to achieve this is by adding a bytes data parameter to the method signature, which is common in the Ethereum community and was codified in ERC-5750. Many existing standards, including ERC-721, ERC-1155, and ERC-1400 (specifically the ERC-1594 component) all conform to this pattern.

I'd like to propose that Zeto also adopt this pattern and add bytes data to each of its mint/transfer methods and events. This does represent a change to the signatures.

Note: There are other ways to allow similar functionality without changing the existing signatures (such as with method overloading, or emitting multiple events instead of only one) - but in my opinion the proposed route would be the cleanest and most consistent with other current token standards.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
Copy link
Contributor

@jimthematrix jimthematrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERC 5750 seems to suggest that a overloading pattern of having and not having the data parameter for the same function is recommended. But I agree with Andrew that it feels overly complicated. If an application does not make use of the data parameter, passing "0x" is simply enough and incurs close to zero cost.

@jimthematrix jimthematrix merged commit 2b3aa22 into hyperledger-labs:main Sep 23, 2024
6 checks passed
@awrichar awrichar deleted the data-param branch September 23, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants